package com.yidu.hbats.service.MentalTraining;

import com.github.pagehelper.PageHelper;
import com.yidu.hbats.dao.AtsSchemeAuditMapper;
import com.yidu.hbats.model.AtsSchemeAudit;
import com.yidu.hbats.model.AtsSchemeExpert;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @program: t272
 * @description 审核的接口实现类
 * @author: 周佳佳
 * @create: 2019-11-25 18:01
 **/
@Service
public class AtsSchemeAuditMentalServiceimpl implements  AtsSchemeAuditMentalService{
    @Resource
    AtsSchemeAuditMapper atsSchemeAuditMapper;
    @Override
    public int insertSelective(AtsSchemeAudit record) {
        Date utilDate = new Date();//util.Date
        java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
        record.setCreatTime(sqlDate);
        //默认传10正在审核
        record.setAuditState("10");
        //默认传1是有效
        record.setIsva(1);
        return atsSchemeAuditMapper.insertSelective(record);
    }

    @Override
    public int updateByPrimaryKeySelectivetwo(AtsSchemeAudit atsSchemeAudit) {
        return atsSchemeAuditMapper.updateByPrimaryKeySelectivetwo(atsSchemeAudit);
    }

    @Override
    public int updateByPrimaryKeySelectivethree(AtsSchemeAudit atsSchemeAudit) {
        return atsSchemeAuditMapper.updateByPrimaryKeySelectivethree(atsSchemeAudit);
    }

    @Override
    public List<AtsSchemeAudit> selectByPrimaryKeyTwo(AtsSchemeAudit atsSchemeAudit,Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return atsSchemeAuditMapper.selectByPrimaryKeyTwo(atsSchemeAudit);
    }

    @Override
    public int selectByPrimaryKeyCountTwo(AtsSchemeAudit atsSchemeAudit) {
        return atsSchemeAuditMapper.selectByPrimaryKeyCountTwo(atsSchemeAudit);
    }

    @Override
    public AtsSchemeAudit selectBySchemeIdFour(int schemeId) {
        return atsSchemeAuditMapper.selectBySchemeIdFour(schemeId);
    }

    @Override
    public int selectByPrimaryKeyCountThree(int schemeId) {
        return atsSchemeAuditMapper.selectByPrimaryKeyCountThree(schemeId);
    }

    @Override
    public int updateByPrimaryKeySelectiveFour(AtsSchemeAudit atsSchemeAudit) {
        return atsSchemeAuditMapper.updateByPrimaryKeySelectiveFour(atsSchemeAudit);
    }
}
